<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <fmt:setBundle basename="ApplicationMessage" />
  <fmt:setLocale value="zh_CN" />

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  <link href="${ctx.resource}/css/select2.css" rel="stylesheet">
  <link href="${ctx.resource}/css/select2-bootstrap.css" rel="stylesheet">
  <link href="${ctx.resource}/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
  <title>清分结算 - 租房宝金融管理平台</title>
  
</head>
<body>

  <%@ include file="/WEB-INF/include/header.jsp"%>
  
  <div class="web-g-main">

    <%@ include file="/WEB-INF/include/aside.jsp"%>
    <div class="content">
      <header class="header clearfix">
          <h3 class="pull-left">清分结算</h3>
       </header>
       <form method="post" action="${ctx}/distribution/settlement/do" data-validate="true"> 
         <div class="row">
           <div class="col-xs-4">
             <div class="input-group date pull-left ">
               <span class="input-group-addon" id="basic-addon1">核销时间</span>
               <input type="text" name="settleDate" value="${settleDate}" class="form-control" data-validate="required"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span>
             </div>  
           </div>
           
           <div class="col-xs-4">
             
             <div class="input-group pull-left">
               <span class="input-group-addon" id="basic-addon1">保理合同编号</span>
               <input type="text" name="contractNo" value="${contractNo}" data-validate="required" class="form-control" placeholder="输入编号" aria-describedby="basic-addon1">
             </div>

           </div>
               
           <button class="btn btn-default btn-shadow btn-shadow-default demo2do-btn" ><i class="glyphicon glyphicon-search"></i>&nbsp;&nbsp;生成清分数据</button>
             
         </div>

       </form>
       <c:if test="${not empty infoMessage}">
            <div class="alert alert-success alert-dismissable alert-fade top-margin-10 text-align-center">
              <button type="button" class="close" data-dismiss="alert">&times;</button>
              <i class="glyphicon glyphicon-info-sign"></i>&nbsp;&nbsp;
              <fmt:message key="${infoMessage}" />
            </div>
       </c:if>

       <c:if test="${not empty factoringContract}">
          <%@ include file="/WEB-INF/jsps/finance/distribution/settlement-detail.jsp"%>
       </c:if>

       <%-- <%@ include file="/WEB-INF/include/footer.jsp"%> --%>
       
    </div>

  </div>
  

  <%@ include file="/WEB-INF/include/script.jsp"%>
  <script src="${ctx.resource}/js/bootstrap-switch.min.js"></script>
  <script src="${ctx.resource}/js/bootstrap-modal-trigger.js"></script>
  <script src="${ctx.resource}/js/select2.min.js"></script>
  <script src="${ctx.resource}/js/select2_locale_zh-CN.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.en.js"></script>
  <script src="${ctx.resource}/js/bootstrap.validate.trigger.js"></script>
  <script src="${ctx.resource}/js/earth-preupload.js"></script>
  <script src="${ctx.resource}/js/bootstrap-alert-fade-trigger.js"></script>
  <script src="${ctx.resource}/js/bootstrap-datetimepicker.min.js"></script>
  <script src="${ctx.resource}/js/bootstrap-datetimepicker.zh-CN.js"></script>
  
  <script type="text/javascript">
    
    $(".input-group.date").datetimepicker({
        format: "yyyy/mm/dd hh:ii:ss",
        autoclose: true,
        todayBtn: true,
        pickerPosition: "bottom-left",
        language: "zh-CN"
    });

    $("#print").bind('click', function(event) {
      
      var url = "${ctx}/distribution/settlement/print?contractNo="+$("input[name='contractNo']").val()+"&settleDate="+$("input[name='settleDate']").val();

      window.open(url,'_blank');

    });

  </script>
  
</body>
</html>
